A surface mounting machine and a component inspection device are provided with a head unit as an electronic component transfer device. The head unit includes a nozzle member and a means for lifting the nozzle member. The head unit being supported by a component conveying unit provided on a platform travels in the horizontal direction to hold, with the nozzle member, an electronic component that has been fed to a predetermined position. The head unit then transfers and mounts the electronic component to a predetermined position. As described in Patent Document 1, the means for lifting the head unit is in the form of a linear motor unit in which a plurality of linear motors are provided in parallel. Each linear motor has a stator, a movable element that linearly reciprocates along the stator, and a magnetic sensor that can detect the position of the movable element. Each magnetic sensor detects a transfer position of the corresponding movable element.    Patent Document 1: Japanese Patent Application Publication No. 2006-67771